FROM golang:1.16-alpine
MAINTAINER lsz
WORKDIR /docker_go
COPY go.mod ./
COPY go.sum ./
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod download
COPY *.go ./
RUN go build -o docker_go .
EXPOSE 8080
CMD ["./docker_go"]